home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
f90
/
set_ieee_rounding_mode.z
/
set_ieee_rounding_mode
Wrap
Text File
|
1998-10-30
|
4KB
|
106 lines
SET_IEEE_ROUNDING_MODE(3I) Last changed: 1-6-98
NNAAMMEE
SSEETT__IIEEEEEE__RROOUUNNDDIINNGG__MMOODDEE - Alters current floating-point rounding mode
state and restores the floating-point rounding mode before exiting a
procedure
SSYYNNOOPPSSIISS
SSEETT__IIEEEEEE__RROOUUNNDDIINNGG__MMOODDEE (([RROOUUNNDDIINNGG__MMOODDEE==]_r_o_u_n_d_i_n_g__m_o_d_e))
IIMMPPLLEEMMEENNTTAATTIIOONN
UNICOS/mk and IRIX systems
CRAY T90 systems that support IEEE arithmetic
SSTTAANNDDAARRDDSS
CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran 90
IEEE Standard for Binary Floating-point Arithmetic
DDEESSCCRRIIPPTTIIOONN
The SSEETT__IIEEEEEE__RROOUUNNDDIINNGG__MMOODDEE intrinsic subroutine is typically used to
alter the current floating-point rounding mode state and to restore
the caller's floating-point rounding mode just before exiting a
procedure. It accepts the following argument:
_r_o_u_n_d_i_n_g__m_o_d_e
Must be scalar and of an integer type that occupies a full
word. It is an IINNTTEENNTT((IINN)) argument.
The floating-point rounding mode is set to the rounding mode
indicated by _r_o_u_n_d_i_n_g__m_o_d_e.
_r_o_u_n_d_i_n_g__m_o_d_e must have one of the values represented by the
following named constants:
* IIEEEEEE__RRMM__NNEEAARREESSTT
* IIEEEEEE__RRMM__PPOOSS__IINNFFIINNIITTYY
* IIEEEEEE__RRMM__ZZEERROO
* IIEEEEEE__RRMM__NNEEGG__IINNFFIINNIITTYY
_r_o_u_n_d_i_n_g__m_o_d_e is assumed to have been set through an
invocation of GGEETT__IIEEEEEE__RROOUUNNDDIINNGG__MMOODDEE(3I).
The IIEEEEEE__RREEAALL(3I) and IIEEEEEE__IINNTT(3I) functions are the only routines
supplied by Cray Research that examine the setting of the rounding
mode on CRAY T90 systems that support IEEE arithmetic, UNICOS/mk
systems, and IRIX systems.
The name of this intrinsic cannot be passed as an argument.
NNOOTTEESS
The IEEE intrinsic procedures use the named constants contained in a
system module, so you must include one of the following statements in
your program:
* On UNICOS and UNICOS/mk systems: UUSSEE CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
* On UNICOS, UNICOS/mk, and IRIX systems: UUSSEE FFTTNN__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
The CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS module is obsolescent. It will be removed
for the CF90 4.0 release.
EEXXAAMMPPLLEESS
! Assume the following code is executing on a machine where default
! integer occupies a full word.
INTEGER save_rounding_mode
! Save the current rounding mode then change the rounding mode
! to round to positive infinity.
CALL GET_IEEE_ROUNDING_MODE(save_rounding_mode)
CALL SET_IEEE_ROUNDING_MODE(IEEE_RM_POS_INFINITY)
! Calculate the upper bound on sum.
DO i = 1, n
xup(i) = y(i) + z(i)
END DO
! Reset to round to negative infinity mode.
CALL SET_IEEE_ROUNDING_MODE(IEEE_RM_NEG_INFINITY)
! Calculate lower bound on sum.
DO i = 1, n
xdn(i) = y(i) + z(i)
END DO
! Restore original rounding mode and return to the caller.
CALL SET_IEEE_ROUNDING_MODE(save_rounding_mode)
SSEEEE AALLSSOO
GGEETT__IIEEEEEE__RROOUUNNDDIINNGG__MMOODDEE(3I)
_I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
printed version of this man page.